package com.qf.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.qf.mapper.DtsGoodsAttributeMapper;
import com.qf.pojo.DtsGoodsAttribute;
import com.qf.service.AttributeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AttributeServiceImpl implements AttributeService {
    @Autowired
    DtsGoodsAttributeMapper goodsAttributeMapper;

    @Override
    public List<DtsGoodsAttribute> findAttributesByGoodsId(Integer id) {
        LambdaQueryWrapper<DtsGoodsAttribute> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(DtsGoodsAttribute::getGoodsId, id);
        wrapper.eq(DtsGoodsAttribute::getDeleted, false);

        List<DtsGoodsAttribute> attributeList = goodsAttributeMapper.selectList(wrapper);

        return attributeList;
    }
}
